﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Text;
using System.Collections.Generic;

namespace ControlExplorer.Controls.Chart
{
    public static class Utils
    {
        public static string SeparateWords(string input)
        {
            var strBuilder = new StringBuilder();
            bool wasNumber = false;
            foreach (char ch in input)
            {
                if (char.IsUpper(ch))
                    strBuilder.Append(" ");

                if (char.IsNumber(ch))
                {
                    if (!wasNumber)
                    {
                        strBuilder.Append(" ");
                        wasNumber = true;
                    }
                }
                else 
                {
                    wasNumber = false;
                }

                strBuilder.Append(ch);
            }
            return strBuilder.ToString();
        }
    }
}
